package cn.com.taiji.learn.sshelloworld.api;

import org.springframework.web.bind.annotation.*;

@RestController
public class HelloController {

    @GetMapping("/hello")
    public String helloWorld(){
        return "波哥yyds";
    }

    @PostMapping("/add")
    public String add(@RequestParam(value = "name", required = true) String name){
//        if(StrUtil.isBlank(name)){
//            throw new RuntimeException("name不能为null");
//        }
        return "successfully add " + name;
    }

    @DeleteMapping("/delete")
    public String delete(@RequestParam(value = "id", required = true) int id){
        return "successfully delete " + id;
    }

    @PutMapping("/update")
    public String update(@RequestParam(value = "id", required = true) int id){
        return "successfully update " + id;
    }
}
